package serializable;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/5/15
 */
public class SerializableDemo2 {
    public static void main(String[] args) {
        try(ObjectInputStream ois = new ObjectInputStream(new FileInputStream("user.txt"));){
            User1 user1=(User1)ois.readObject();
            System.out.println(user1);
        } catch(IOException e){
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
}
